import Vue from 'vue'

const component = {
  template: `
  <div>
  123123
  <div><span v-show='active'>123123</span></div>
  <div><span>{{compOne}}</span></div>

  <button @click='test123'>btn</button>
  </div>
  `,
  props: {

    compOne: String,

  },
  mounted () {

  },
  data () {
    return {
      active: false
    }
  },
  methods: {

    test123 () {
      this.active = !this.active
      this.$emit('compM', 123);
    }
  }

}

new Vue({
  components: {
    comp: component
  },
  template: `<div><comp :compOne='testStr' @compM='compMethod'></comp></div>`,
  el: '#app',
  data () {
    return {
      testStr: '1231a'
    }
  },
  methods: {
    compMethod (value) {
      console.log(value, 'compMethod')
    }
  }
})
